#include "chapter3.h"

#include <iostream>
#include <tr1/memory>

Chapter3::Chapter3()
: n(3) {}

Chapter3::~Chapter3()
{
  std::cout << "Bye\n";
}

Chapter3::operator int() const
{
  return n;
}

void Chapter3::doStuff()
{
  std::cout << "stuff\n";
}

int main(int argc, char* argv[])
{
  Chapter3 chapter3;
  chapter3.doStuff();

  std::tr1::shared_ptr<Chapter3> ptr(new Chapter3());
  ptr.get()->doStuff();
  ptr->doStuff();
  ptr.reset();
  
  int x1 = chapter3;
  std::cout << x1 << std::endl;
  
  typedef std::string Lines[4];
  Lines l;
  l[2] = "what\n";
  std::cout << l[2];
  std::string *p = new Lines;
  delete p;
  
  int x;
  std::cin >> x; 
  std::cout << x;
 
  
  return 0;
}